<div class="left-container">
    <!-- LOGO      __PUBLIC__/Images/index/logo.png             -->
    <!-- 菜菜       __PUBLIC__/Images/index/Home -emoticons.png  -->
    <!-- 首页 /           -->
    <!-- 供求 /sd         -->
    <!-- 文章 /pages      -->
    <!-- 咨询 /news       -->
    <!-- 视频 /movieplay  -->
    <!-- 活动 /activepage -->

    <div class="left-nav-container">
        <div class="logo" style="background-image: url(__IMAGE__/common/logo.png);"></div>
        <div class="nav-container">
            <a href="/">
                <div class="nav-item">
                    <span>首页</span>
                </div>
            </a>
            <a href="/sd.html">
                <div class="nav-item">
                    <span>供求</span>
                </div>
            </a>
            <a href="/pages.html">
                <div class="nav-item">
                    <span>文章</span>
                </div>
            </a>
            <a href="/news.html">
                <div class="nav-item">
                    <span>资讯</span>
                </div>
            </a>
            <a href="/movieplay.html">
                <div class="nav-item">
                    <span>视频</span>
                </div>
            </a>
            <a href="/activepage.html">
                <div class="nav-item">
                    <span>活动</span>
                </div>
            </a>
            
        </div>
        <div class="footer">
            <div class="caicai" style="background-image: url(__IMAGE__/common/caicai.png);"></div>
            <div class="btn">
                <span class="btn-icon" style="background-image: url(__IMAGE__/common/btn03.png);"></span>
                <a href="/hezuo.html" style="flex: 0.7">
                    <span class="btn-title">寻求合作</span>
                </a>
            </div>
            <div class="btn" onclick="layeralert()" style="cursor: pointer;">
                <span class="btn-icon" style="background-image: url(__IMAGE__/common/btn02.png);"></span>
                <span class="btn-title">我要投稿</span>
            </div>
        </div>
    </div>
    <!-- layui里面，没有在文档流里面的内容会不显示 -->
    &nbsp;  
</div>

<!-- 根据url切换 -->
<script>
    $(()=>{
        let nav = '/'
        let url = window.location.href.split("/");
        let position = url[url.length - 1].split(".")[0].replace('supply','').replace('demand','_');
        let tabs = $(".nav-container").children("a");
        let is_mark = false;
        for(let i = 0; i < tabs.length; i++){
            let tab_url = $(tabs[i]).attr('href').split("/");
            let page = tab_url[tab_url.length - 1]
            if(page !== ""){
                page = page.split('.')[0];
                switch(position){
                    case page:
                        let p_d =$( $(tabs[i]).children('div'))
                        p_d.addClass('nav-item-active')
                        is_mark = true;
                    break;
                    case "last":
                    case "high":
                    case "low":
                    case "_last":
                    case "_high":
                    case "_low":
                    case "_":
                        let sd_d =$($(tabs[1]).children('div'))
                        sd_d.addClass('nav-item-active')
                        is_mark = true;
                    break;
                }
            }else{
                if(position === page){
                    let div =$( $(tabs[i]).children('div'))
                    div.addClass('nav-item-active')
                    is_mark = true;
                }
            }
        }
        if(!is_mark){
            let index = 0;
            switch(nav){
                case "news":
                    index = 3;
                    break;
                case "paper":
                    index = 2;
                    break;
                case "spd":
                    index = 1;
                    break;
                case "dd":
                    index = 1;
                    break;            
            }
            let div =$( $(tabs[index]).children('div'))
            div.addClass('nav-item-active')
        }
    })
</script>
<!-- 我要投稿弹窗事件 -->
<script>
layeralert = () => {
    layer.open({
        type: 2,
        title: false,
        shadeClose: false,
        shade: [0.4, '#333333'],
        offset: '10rem',
        scrollbar: false,
        closeBtn: 1,
        maxmin: false, //开启最大化最小化按钮
        area: ['520px', '430px'],
        content: ["/tougao", 'no']

    })
}
</script>

